﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Xinkui.WebModel.BasicControl;
using Xinkui.WebModel.Model;
using Xinkui.DataAccess.AutoGenerator;
using Xinkui.Common;

public partial class UserControl_ShowRoom_UC_Right_Home : ShowRoomControl {
    protected void Page_Load(object sender, EventArgs e) {

        List<PropertyItem> properties = new List<PropertyItem>(10);

        if (!string.IsNullOrEmpty(this.CompanyView.BussinessTypeName))
            properties.Add(new PropertyItem {
                Title = "Bussiness Type",
                Value = this.CompanyView.BussinessTypeName
            });
        if (!string.IsNullOrEmpty(this.CompanyView.CompanyEntity.MainProduct))
            properties.Add(new PropertyItem {
                Title = "Main Products",
                Value = this.CompanyView.CompanyEntity.MainProduct
            });



        if (!string.IsNullOrEmpty(this.CompanyView.NumberOfEmpoyeesName))
            properties.Add(new PropertyItem {
                Title = "Number of Employees",
                Value = this.CompanyView.NumberOfEmpoyeesName
            });



        if (!string.IsNullOrEmpty(this.CompanyView.CompanyEntity.YearEstabished))
            properties.Add(new PropertyItem {
                Title = "Year of Established",
                Value = this.CompanyView.CompanyEntity.YearEstabished
            });
        if (!string.IsNullOrEmpty(this.CompanyView.TotalAnnualSalesName))
            properties.Add(new PropertyItem {
                Title = "Annual Turnover",
                Value = this.CompanyView.TotalAnnualSalesName
            });


        this.rptPropertiesDataSource.DataSource = properties;
        this.rptPropertiesDataSource.DataBind();

        this.rptFeaturedProduct.DataSource = Singleton<ProductInfoDataAccess>.Instance.ListShowRoomFeaturedProducts(8, this.BasePage.ShowRoomIdentity);
        this.rptFeaturedProduct.DataBind();

    }
}